package com.mall.db.api;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.mall.db.mapper.OmsCompanyAddressMapper;
import com.mall.domain.OmsCompanyAddress;
import com.mall.interface1.api.OmsCompanyAddressApi;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@DubboService
public class OmsCompanyAddressApiImpl implements OmsCompanyAddressApi {

    @Autowired
    private OmsCompanyAddressMapper companyAddressMapper;

    //根据发货点公司地址id，查询发货点公司详情
    public OmsCompanyAddress findCompanyAddressById(Long id) {
        return companyAddressMapper.selectById(id);
    }

    //获取所有收货地址
    public List<OmsCompanyAddress> selectAll() {
        QueryWrapper<OmsCompanyAddress> qw = new QueryWrapper<>();
        return companyAddressMapper.selectList(qw);
    }
}
